<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
</head>

<script type="text/javascript">
    function check(){
        var file = document.getElementById("uploadfile").value;
        if(file == ""){
            alret("上传文件为空，不能上传");
            return false;
        }
        return true;
    }
</script>

<body>
<form action="/UserController/upload" method="post" enctype="multipart/form-data" onsubmit="return check()">
    请选择文件:<input type="file" name="files" multiple="multiple"/>
    &nbsp;&nbsp;
    <input type="submit" value="上传" />
</form>
<a href="${pageContext.request.contextPath}/download?filename=111.png">文件下载</a>
</body>
</html>